# Python选项
PY = python3

# 找到所有的Python源文件，位于 src 目录下
SRC_PY = $(wildcard *.py)
# 目标是运行Python脚本
TARGETS_PY = $(SRC_PY)

OBJ = $(wildcard *.tex)

# 默认目标
all: run doc

run: $(SRC_PY)
	$(PY) $(SRC_PY)

doc: ${OBJ}
	@xelatex $^
	@bibtex main.aux
	@xelatex $^
	@xelatex $^

.PHONY:clean
clean:
	rm -f *.aux *.bbl *.blg *.log *.run.xml *.pdf *.synctex.gz main.bbl main-blx.bib
	latexmk -c 